    <div id="breadcrumbs"><?php echo $this->Html->link('Home', array('controller' => 'contents', 'action' => 'view', 'home')); ?> > List Resources
</div>
<?php if ($this->Session->read('Auth.User.role_id') == 1 || $this->Session->read('Auth.User.role_id') == 2) { ?>
    <div class="resources index">
    <?php } ?>
    <h2><?php echo __('Resources'); ?></h2>

    <?php
    echo $this->Form->create('Resources', array('action' => 'index', 'inputDefaults' => array('label' => false)));
    ?>
    <br>
    <div class="input-group">
        <?php echo $this->Form->input('search', array('type' => 'text', 'class' => 'form-control')); ?>
        <span class="input-group-btn">
            <?php echo $this->Form->button('Search', array('type' => 'submit', 'class' => 'btn btn-default')); ?>
        </span>
    </div>


    <?php echo $this->Form->end(); ?>
    <br>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo $this->Paginator->sort('res_name', 'Resource'); ?></th>
            <th><?php echo $this->Paginator->sort('res_desc', 'Description'); ?></th>
            <th><?php echo $this->Paginator->sort('cat_id', 'Category'); ?></th>
            <th>View</th>
            <?php if ($this->Session->read('Auth.User.role_id') == 1 || $this->Session->read('Auth.User.role_id') == 2) { ?>
                <th>Edit</th>
                <th>Delete</th>
            <?php } ?>
        </tr>
        <?php foreach ($resources as $resource): ?>
            <tr>
                <td><?php echo h($resource['Resource']['res_name']); ?>&nbsp;</td>
                <td><?php echo h($resource['Resource']['res_desc']); ?>&nbsp;</td>
                <td>
                    <?php echo $this->Html->link($resource['Catagory']['cat_name'], array('controller' => 'catagories', 'action' => 'view', $resource['Catagory']['cat_id'])); ?>
                </td>
                <td><?php echo $this->Html->image('view.png', array('alt' => 'View', 'url' => array('action' => 'view', $resource['Resource']['res_id']))); ?></td>
                <?php if ($this->Session->read('Auth.User.role_id') == 1 || $this->Session->read('Auth.User.role_id') == 2) { ?>
                    <td><?php echo $this->Html->image('edit.png', array('alt' => 'Edit', 'url' => array('action' => 'edit', $resource['Resource']['res_id']))); ?></td>
                    <td><?php echo $this->Form->postLink($this->Html->image('delete.png', array('alt' => __('Delete'))), array('action' => 'delete', $resource['Resource']['res_id']), array('escape' => false, 'confirm' => __('Are you sure you want to delete ' . $resource['Resource']['res_name'] . '?'))); ?></td>

                <?php } ?>
            </tr>
        <?php endforeach; ?>
    </table>
    <div class="paging">
        <?php
        echo $this->Paginator->prev('< ' . __('Previous'), array(), null, array('class' => 'prev disabled'));
        echo $this->Paginator->numbers(array('separator' => ''));
        echo $this->Paginator->counter(array('format' => __('Page {:page} of {:pages}')));
        echo $this->Paginator->next(__('Next') . ' >', array(), null, array('class' => 'next disabled'));
        ?>
    </div>
    <?php if ($this->Session->read('Auth.User.role_id') == 1 || $this->Session->read('Auth.User.role_id') == 2) { ?>
    </div>


    <div class="actions">
        <h3><?php echo __('Actions'); ?></h3>
        <ul>
            <li><?php echo $this->Html->link(__('New Resource'), array('action' => 'add')); ?></li>
        </ul>
    </div>
    <?php
}?>